9 std::vector
<std::vector
<int>> RhythmIO::createBeatPatterns(std::string path
) {
10 return convertBeatMap(readBeatMap(path
));
13 std::vector
<int> RhythmIO::readBeatMap(std::string path
) {
14 std::ifstream
file(path
);
17 std::vector
<int> data
= splitInt(line
, ' ');
21 // trim out the zeros and get the times of each
22 std::vector
<std::vector
<int>> RhythmIO::convertBeatMap(std::vector
<int> data
) {
25 std::vector
<std::vector
<int>> keys
;
26 for (int numbers
: data
) {
31 else if (numbers
!= 0) {
32 keys
.push_back(std::vector
<int>({numbers
, count
}));
35 std::cout
<< " ERROR\n";
38 std::cout
<< keys
.at(temp
- 1).at(0) << "\t";
43 void RhythmIO::bufferBeatData(vector
<vector
<int>> keys
, long long musicStart
, vector
<vector
<long long >>* hitData
, vector
<vector
<long long >>* cueData
) {
44 int keySize
= keys
.size();
45 for (int i
= 0; i
< 16; i
++) {
46 if (keyPositions
< keySize
) {
47 if (keys
.at(keyPositions
).at(0) > 0 && keys
.at(keyPositions
).at(0) < 10) {
48 hitData
->push_back(std::vector
<long long>({ musicStart
+ (long long)keys
.at(keyPositions
).at(1), keys
.at(keyPositions
).at(0) }));
49 std::cout
<< "\nHit Data:\t" << musicStart
+ (long long)keys
.at(keyPositions
).at(1) ;
51 else if (keys
.at(keyPositions
).at(0) >= 10) {
52 cueData
->push_back(std::vector
<long long>({ musicStart
+ (long long)keys
.at(keyPositions
).at(1), keys
.at(keyPositions
).at(0) }));
53 std::cout
<< "\nHit Data:\t" << musicStart
+ (long long)keys
.at(keyPositions
).at(1);